package com.sky.sky_server.mapper;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.sky.sky_pojo.entity.User;

@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User selectByOpenid(String openid);

    /**
     * 插入用户
     * @param user
     * @return
     */
    int insert(User user);

    /**
     * 用户统计，查询每天新增的用户数量
     * @param begin
     * @param end
     * @return
     */
    List<Integer> userStatistics(LocalDate begin, LocalDateTime end);
    
}
